Skip to content

Don't lose half of the processor's serial number#708

Merged
dhalbert merged 1 commit into
adafruit:masterfrom
jepler:cpu-uid-nibbles
Mar 26, 2018
Merged

Don't lose half of the processor's serial number#708
dhalbert merged 1 commit into
adafruit:masterfrom
jepler:cpu-uid-nibbles

Conversation

@jepler
Copy link
Copy Markdown

@jepler jepler commented Mar 25, 2018

Before this change, microcontroller.cpu.uid returned values
where the top 4 bits of each byte were zero, because of
an incorrect bitmask used in this function.

Testing performed: Looked at the value on my Trinket M0

>>> ''.join('%02X' % c for c in microcontroller.cpu.uid
'1B45FF004E4E4D5120202031251011FF'

Before the fix, the value was shown as 0B050F000E0E0D01000000010500010F, because 4 out of every 8 bits were lost.

Before this change, `microcontroller.cpu.uid` returned values
where the top 4 bits of each byte were zero, because of
an incorrect bitmask used in this function.
Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks!

@dhalbert dhalbert merged commit df73188 into adafruit:master Mar 26, 2018
@jepler jepler deleted the cpu-uid-nibbles branch August 2, 2018 01:23
@jepler jepler restored the cpu-uid-nibbles branch August 2, 2018 01:23
@jepler jepler deleted the cpu-uid-nibbles branch August 2, 2018 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants